package chapter08

/**
 * 定义样例类
 * 代替了上面的
 */
object Test05_MatchCaseClass {
  def main(args: Array[String]): Unit = {
    val student = Student1("alice", 18)

    val str = student match {
      case Student1("alice", 18) => "alice 18"
      case _ => "ELSE"
    }

    println(str)

  }
}

//定义样例类

case class Student1(name: String, age: Int)